import React, { useEffect, useState } from 'react'
import { Swiper, Image } from 'react-vant';
import instance from '../../axios/instance';

function Index() {
  const [lunData,setLunData]=useState([])

  useEffect(() => {
    instance.get('/health/share/v1/bannersShow').then(res => {
      console.log('reslun', res)
      if(res.status===200){
        setLunData(res.data.result)
      }
    })
  }, [])

  return (
    <div>
      <Swiper autoplay={5000}>
        {lunData.map((item,index) => (
          <Swiper.Item key={index}>
            <Image lazyload src={item.imageUrl} style={{height:'180px'}} />
          </Swiper.Item>
        ))}
      </Swiper>
    </div>
  )
}

export default Index
